/*
 * GStandingsType.java
 * Created on 25 juin 2007
 *
 * Glacéo Internet Platform
 * http://sourceforge.net/projects/chm/
 *
 * Copyright (c) 2005-2008, Jens and Jan Janke (VirtualHockey Project)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hockeo.vhbase.data.helper;

/**
 * Describes the type of a standings record (Basically indicates if the standings record
 * counts all matches or only home or away matches).
 *
 * @version $Id$
 * @author jjanke
 */
public enum GStandingsType
{
  /** Designates a total standings object. */
  TOTAL,

  /** Designates a standings object containing data from home games only. */
  HOME,

  /** Designates a standings object containing data from road games only. */
  AWAY;

  /**
   * Checks whether the given GStandingsType is compatible with the provided match type.
   *
   * @param matchType the match type with which to compare
   * @return <code>true</code> if the match and standings type are compatible
   */
  public boolean isCompatible( GMatchType matchType )
  {
    if ( this == HOME && matchType == GMatchType.HOME )
      return true;

    if ( this == AWAY && matchType == GMatchType.AWAY )
      return true;

    return false;
  }
}
